// watermark.js
export default {
    bind(el, binding) {
      const { text, font = '16px Microsoft YaHei', color = 'rgba(184, 184, 184, 0.6)' } = binding.value;
      const canvas = document.createElement('canvas');
      canvas.width = 200;
      canvas.height = 200;
  
      const ctx = canvas.getContext('2d');
      ctx.rotate((-20 * Math.PI) / 180);
      ctx.font = font;
      ctx.fillStyle = color;
      ctx.textAlign = 'left';
      ctx.textBaseline = 'middle';
      ctx.fillText(text, canvas.width / 10, canvas.height / 2);
  
      el.style.backgroundImage = `url(${canvas.toDataURL('image/png')})`;
    }
  };
  